<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<%@ page isELIgnored="false" %>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>上传视频--teacher</title>
    <style>
        .smart-green {
            margin-left:auto;
            margin-right:auto;
            max-width: 500px;
            background: #F8F8F8;
            padding: 30px 30px 20px 30px;
            font: 12px Arial, Helvetica, sans-serif;
            color: #666;
            border-radius: 5px;
            -webkit-border-radius: 5px;
            -moz-border-radius: 5px;
        }
        .smart-green h1 {
            font: 24px "Trebuchet MS", Arial, Helvetica, sans-serif;
            padding: 20px 0px 20px 40px;
            display: block;
            margin: -30px -30px 10px -30px;
            color: #FFF;
            background: #0fccbc;
            text-shadow: 1px 1px 1px #949494;
            border-radius: 5px 5px 0px 0px;
            -webkit-border-radius: 5px 5px 0px 0px;
            -moz-border-radius: 5px 5px 0px 0px;
            border-bottom:1px solid #89AF4C;

        }
        .smart-green h1>span {
            display: block;
            font-size: 11px;
            color: #FFF;
        }

        .smart-green label {
            display: block;
            margin: 0px 0px 5px;
        }
        .smart-green label>span {
            float: left;
            margin-top: 10px;
            color: #5E5E5E;
        }
        .smart-green input[type="text"], .smart-green input[type="email"], .smart-green textarea, .smart-green select {
            color: #555;
            height: 30px;
            line-height:15px;
            width: 100%;
            padding: 0px 0px 0px 10px;
            margin-top: 2px;
            border: 1px solid #E5E5E5;
            background: #FBFBFB;
            outline: 0;
            -webkit-box-shadow: inset 1px 1px 2px rgba(238, 238, 238, 0.2);
            box-shadow: inset 1px 1px 2px rgba(238, 238, 238, 0.2);
            font: normal 14px/14px Arial, Helvetica, sans-serif;
        }
        .smart-green textarea{
            height:100px;
            padding-top: 10px;
        }
        .smart-green select {
            /*background: url('../images/logo.png') no-repeat right, -moz-linear-gradient(top, #FBFBFB 0%, #E9E9E9 100%);*/
            /*background: url('') no-repeat right, -webkit-gradient(linear, left top, left bottom, color-stop(0%,#FBFBFB), color-stop(100%,#E9E9E9));*/
            appearance:none;
            -webkit-appearance:none;
            -moz-appearance: none;
            text-indent: 0.01px;
            text-overflow: '';
            width:100%;
            height:30px;
        }
        .smart-green .button {
            background-color: #9DC45F;
            border-radius: 5px;
            -webkit-border-radius: 5px;
            -moz-border-border-radius: 5px;
            border: none;
            padding: 10px 25px 10px 25px;
            color: #FFF;
            text-shadow: 1px 1px 1px #949494;
        }
        .smart-green .button:hover {
            background-color:#80A24A;
        }
    </style>
</head>
<body>
<label>
    <span>视频分类:</span>
    <select id="exam_type" name="exam_type" onchange="pd()">
        <option value="教学视频">教学视频</option>
        <option value="课堂回放">课堂回放</option>
    </select>
</label>
<form action="/examproject/stu/createvideo" enctype="multipart/form-data" id="myform" method="post" class="smart-green">
    <h1>发布视频
        <span>Create the video---教学视频</span>
    </h1>
    <input type="hidden" value="教学视频" name="vtype">
    <label>
        <span>视频昵称 :</span>
        <input id="name" type="text" name="vname" placeholder="请输入视频昵称" />
    </label>
    <label>
        <span>视频描述 :</span>
        <input id="email" type="text" name="vdesc" placeholder="请输入视频描述" />
    </label>
    <label>
        <span>视频地址 :</span>
        <input type="file" id="wj" name="vurl" />
    </label>
    <label>
        <input type="submit" class="button" value="发布" />
    </label>
</form>
<!--课堂回放-->
<form action="/examproject/stu/createvideo" enctype="multipart/form-data" id="myform1" method="post" class="smart-green" style="display: none">
    <h1>发布视频
        <span>Create the video---课堂回放</span>
    </h1>
    <input type="hidden" value="课堂回放" name="vtype">
    <label>
        <span>所属班级:</span>
        <select name="classid" id="sid">
        </select>
    </label>
    <label>
        <span>视频昵称 :</span>
        <input id="nc" type="text" name="vname" placeholder="请输入视频昵称" />
    </label>
    <label>
        <span>视频描述 :</span>
        <input id="ms" type="text" name="vdesc" placeholder="请输入视频描述" />
    </label>
    <label>
        <span>视频地址 :</span>
        <input type="file" id="wj" name="vurl" />
    </label>

    <label>
        <input type="submit" class="button" value="发布" />
    </label>
</form>
<script>
    //ajax请求班级
    var xmlhttp=new XMLHttpRequest();
    window.onload=function(){
        xmlhttp.open("GET","/examproject/stu/cls",true);
        xmlhttp.send();
        xmlhttp.onreadystatechange=function(){
            if(xmlhttp.readyState==4 && xmlhttp.status==200){
                var sz=JSON.parse(xmlhttp.responseText);
                var obj=document.querySelector("#sid");
                for(var i=0;i<sz.length;i++){
                    var op=new Option(sz[i].className,sz[i].classId);
                    obj.appendChild(op);
                }
            }
        }
    }
    function pd() {
        var val=document.getElementById("exam_type");
        var form=document.getElementById("myform");
        var form1=document.getElementById("myform1");
        if(val.value=="教学视频"){
            form.style.display="block";
            form1.style.display="none";
        }else{
            form1.style.display="block";
            form.style.display="none";
        }
    }
</script>
</body>
</html>